<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<link rel="stylesheet" href="../../common.css">
<style>
    .box {
        border: 2px solid #fff;
        width: 200px;
        height: 200px;
        transform-style: preserve-3d;
        border-radius: 50%;
        /* transform: scaleY(0.5) rotateZ(45deg); */
        animation: box-rotate 2s linear infinite;
        position: relative;
        margin-bottom: 20px;
    }

    .circle {
        width: 30px;
        height: 30px;
        left: calc(50% - 15px);
        top: -15px;
        position: absolute;
        border-radius: 50%;
        background-color: orange;
        /* transform: rotateZ(-45deg) scaleY(2); */
        animation: dot-rotate 2s linear infinite;
    }

    /* 公转动画 */
    @keyframes box-rotate {
        0% {
            transform: rotate(45deg) scaleY(0.5) rotate(0);
        }

        100% {
            transform: rotate(45deg) scaleY(0.5) rotate(360deg);
        }
    }

    /* 自转动画*/
    @keyframes dot-rotate {
        0% {
            transform: rotate(0) scaleY(2) rotate(-45deg);
        }

        100% {
            transform: rotate(-360deg) scaleY(2) rotate(-45deg);
        }
    }
</style>

<body>
    <section>
        <div class="box">
            <div class="circle"></div>
        </div>
    </section>

</body>

</html>
<!-- transform 参数的执行顺序:
    分先后执行：后传入的先执行，但实际计算是以矩阵：matrix 的方式去算的），且转换会改变坐标轴。
    skew、scale、rotate... 本质上都是用 matrix。
 -->